import 'package:flutter/material.dart';
import 'package:flutter_module/page_a.dart';
import 'package:flutter_module/page_b.dart';

void main(){
  runApp(MyApp());
  // testFuture();
}

class MyApp extends StatelessWidget {
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    print('MyApp build');
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(primarySwatch: Colors.blue, splashColor: Colors.transparent),
      routes: MYRouter.routes,    //路由map
      initialRoute: PageB.routeName,
    );
  }
}

class MYRouter {
  static final Map<String, WidgetBuilder> routes = {
    PageA.routeName: (ctx) =>PageA(), // 记得在页面里面 声明静态变量 static const String routeName = "/";
    PageB.routeName: (ctx) => PageB()//  声明静态变量 static const String routeName = "/about";
  };

}